/**
 * Created by henian.xu on 2017/6/7.
 *
 */

const gulp = require('gulp'),
  babel = require('gulp-babel'),
  sourcemaps = require('gulp-sourcemaps'),
  amdOptimize = require('amd-optimize'),
  concat = require('gulp-concat');

gulp.task('default', function () {
  return gulp.src('src/**.js')
  // .pipe(sourcemaps.init())
    .pipe(babel())
    .pipe(amdOptimize('main'))
    .pipe(concat('all.js'))
    // .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest('dist'));
});


gulp.task('W:all', function () {
  gulp.watch(['src/**.js'], ['default'])
});